meta tags in index.html

Just starting out? Need help? Post your questions and find answers here.
menschmarkus
Posts: 54
Joined: Thu Apr 10, 2014 3:35 pm

meta tags in index.html

Post by menschmarkus »

Hi @all,

just one question, how can I add meta tags like 'description', 'keywords', 'author' to the <head> area in automated generated index.html while compiling?
OK I mean automated during compiling, not manually after compiling ;)
Possibly it can be added to compiler options.
as soon you do it right, it works !
hoerbie
Posts: 137
Joined: Sun Mar 17, 2019 5:51 pm
Location: DE/BY/MUC

Re: meta tags in index.html

Post by hoerbie »

Hi,

does something like

Code: Select all

! $('head').append('<here the html code>');
at the head of your SB code not work?
menschmarkus
Posts: 54
Joined: Thu Apr 10, 2014 3:35 pm

Re: meta tags in index.html

Post by menschmarkus »

hoerbie wrote: Fri Jun 28, 2024 9:41 am Hi,

does something like

Code: Select all

! $('head').append('<here the html code>');

at the head of your SB code not work?
nope. Doesn't work

Code: Select all

Procedure main()
  ! $('head').append('<meta name="keywords" content="keywords here">')
  ! $('head').append('<meta name="description" content="description here">')
  ! $('head').append('<meta name="author" content="author info here">')

endprocedure
main()
if you look to index.html (or whatever the start html is named) does not show additional meta tags
as soon you do it right, it works !
User avatar
Peter
Posts: 1197
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1:9080
Contact:

Re: meta tags in index.html

Post by Peter »

works here
Image
User avatar
useful
Posts: 135
Joined: Tue Feb 25, 2014 1:15 pm

Re: meta tags in index.html

Post by useful »

Peter wrote: Fri Jun 28, 2024 1:37 pm works here
Is this enough to index the site?
2B or not 2B = FF
User avatar
Peter
Posts: 1197
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1:9080
Contact:

Re: meta tags in index.html

Post by Peter »

Unfortunately, I don't know enough about meta data in an html page. I am also of the opinion that they should be present in the page from the beginning and not be inserted manually by JavaScript.

I have written a small SpiderBasic tool that allows you to manipulate the HTML file generated by SpiderBasic before it is displayed in the browser: HtmlPreprocessor for SpiderBasic

This makes it possible to insert the meta data directly into the HTML page.
menschmarkus
Posts: 54
Joined: Thu Apr 10, 2014 3:35 pm

Re: meta tags in index.html

Post by menschmarkus »

Peter wrote: Fri Jun 28, 2024 4:10 pm Unfortunately, I don't know enough about meta data in an html page. I am also of the opinion that they should be present in the page from the
beginning and not be inserted manually by JavaScript.
I agree. As I know meta tags have to be natively in the starting html because the html header is checked by crawlers, not js scripts.
Peter wrote: Fri Jun 28, 2024 4:10 pmI have written a small SpiderBasic tool that allows you to manipulate the HTML file generated by SpiderBasic before it is displayed in the browser: HtmlPreprocessor for SpiderBasic

This makes it possible to insert the meta data directly into the HTML page.
I will check it soon and report the result.
Thanks Peter
as soon you do it right, it works !
Post Reply