CDS Invenio: add meta information (tag keywords / description)
Some search engines, like google, use the meta information in your web pages. CDS-Invenio shows by default the values included in its config file (invenio.conf). This information is static, and the same for all pages…
For instance, if you go to zaguan.unizar.es and press CTRL+U to see the source code, you will notice the following lines in the head section:
1 2 | <meta name="description" content="Repositorio Digital de la Universidad de Zaragoza - Repositorio Digital de la Universidad de Zaragoza" /> <meta name="keywords" content="Repositorio Digital de la Universidad de Zaragoza, Repositorio Digital de la Universidad de Zaragoza" /> |
I decided to include information related to records in these meta information tags. So I modified <$PATH_TO_CDS>/lib/python/invenio/websearch_templates_buz.py (the file which produces the output for the records).
Edit: More precisely, you should look around line 475 of websearch_templates_$yoursitename.py where tmpl_record_page_header is defined.
I included these lines:
1 2 3 4 5 6 7 8 9 10 11 12 |
489 keywords = ', '.join(get_fieldvalues(recid, "653%"))
490 # ----- modified by miguel para que en la descripcion ponga tb zaguan
491 description = 'zaguan - repositorio universidad de zaragoza'
492 description += "\n"
493 description += ' '.join(get_fieldvalues(recid, "100__a") + get_fieldvalues(recid, "700__a"))
494 description += "\n"
495 # ----- modified by miguel: añadidas las dos siguientes lineas para que muestre tb el titulo
496 description += ' - '.join(get_fieldvalues(recid, "245%"))
497 description += "\n"
498 # ----- y por ultimo que muestre el abstract --------
499 description += '; '.join(get_fieldvalues(recid, "520__a")) |
Now if you check the source code of a record (for instance: This record you’ll notice new information in the description tag, as shown below:
1 2 3 | <meta name="description" content="zaguan - repositorio universidad de zaragoza tiraBUZón - boletín informativo de la Biblioteca de la Universidad de Zaragoza Estudiantes: ¿hay alguien ahi? - Conoce mejor la biblioteca - Encuentros profesionales - Formación - Utilidades - Noticias - Actividades culturales - Felicitamos a..." /> |
Hope this helps to position your website in google
Related posts:
- CDS Invenio: query database to know a tag value from a record
- CDS Invenio: Get Record number (recid, sysno) from reference number
- CDS Invenio: avoid duplicate content on comments and other record tabs
- CDS-Invenio: bibrecdocfile
- CDS Invenio: batch delete records (delete records from command line) [SOLVED]