Sitemap file multilingual with dynamic content [closed] - seo

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 2 years ago.
Improve this question
I have a DYNAMIC website with 4 different languages, I would like to set the sitemap.xml file, I have some questions to set how to start:
1- Is the sitemap.xml is still mandatory in SEO? Because I've visited so many websites well ranked and they don't have that file
2- The best way to set a sitemap, is to include dynamic fields or not, i.e: I add entries into the database, do I have to include them or just constant pages, such as, contact, home page, about us ...
If do I have to set dynamic items, do I have to generate 4 sitemaps, each language with it's own sitemap, OR I should combine all of them?
This is what I did, I combined all the languages in one file, as of dynamic page 1 and dynamic page2, this will generate 1000 lines as dynamic pages, each entry will have a translation in 4 languages:
<?xml version=”1.0″ encoding=”UTF-8″?>
<urlset xmlns=”http://www.sitemaps.org/schemas/sitemap/0.9″
xmlns:xhtml=”http://www.w3.org/1999/xhtml”>
<url>
<loc>http://www.example.com/en/dynamic-page1.html</loc>
<xhtml:link
rel="alternate"
hreflang="fr"
href="http://www.example.com/fr/page-dynamique1.html" />
<xhtml:link
rel="alternate"
hreflang="en"
href="http://www.example.com/en/dynamic-page1.html" />
</url>
<url>
<loc>http://www.example.com/en/dynamic-page2.html</loc>
<xhtml:link
rel="alternate"
hreflang="fr"
href="http://www.example.com/fr/page-dynamique2.html" />
<xhtml:link
rel="alternate"
hreflang="en"
href="http://www.example.com/en/dynamic-page2.html" />
</url>
</urlset>
Thank you in advance

Yes, it's preferable to have sitemap because this is another signal for Google to pick up for your preferred pages to index.
Combined all the languages in one file with dynamic page 1 and 2 is fine. The only thing that I will say is to the add last modify date, example
<lastmod>2020-03-04</lastmod>
The sitemaps should be no larger than 50MB (52,428,800 bytes) and can contain a maximum of 50,000 URLs
You can create different sitemap based on your site structure, e.g. Product sitemap, services, blog, and so on this will help in debugging and analysis your page's performance on GSC.

Related

How to convert multiple markdown docs with links between them into one pdf?

I am maintaining a set of documents in markdown which have links to other markdown documents and to webpages, and embedded images. I am looking for a tool which can convert these documents into a single pdf, while preserving all of those aspects of it (with links between documents pointing at the beginning of the corresponding document within the pdf).
The closest question, found here, does not have any answers which meet my requirements. Pandoc does not handle links within the document well, and follows relative links relative to my working directory, not where the markdown file in question is. The answer suggesting Typora only handles links within one document, which are not relevant to my use-case.
Are there any tools which enable me to do this?
If I've understood you requirements correctly you want to merge pdfs that contain links to each other (as separate files) but that when they are combined the link no longer points to an external file but points to the correct part in this new document?
This can be achieved with pandoc, as per the answer you linked to:
pandoc *.md -o result.pdf
However, to get this to work as you wish you will have to change the links to the external files to reference the first header in that file. For example, I have two .md files (example1.md and example2.md)
example1.md
# This is document 1
Lorem ipsum ...
Link to [header 2, in this document](#header-2)
Link to [document 2](#this-is-document-2)
## Header 2
Lorem ipsum...
example2.md
# This is document 2
Lorem ipsum...
[This link should point to the 'first-document' part](#this-is-document-1)
When the above command is complete result.pdf will work as you'd like.
As you can see the trick is to change what would have been a link to the other external .md files to internal links with the correct header.
How you do this is upto you but you could program this easily to make the desired changes across multiple documents.

Whole site compilation of markdown/pandoc? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
With Sphinx-doc, you can create a bunch of ReStructureText files, with an index.rst file which includes a table of contents macro that auto generates a table of contents from the other included files, and a conf.py that acts as a compilation config. You can then compile the lot into a single python-doc-style site, complete with index, navigation tools, and a search function.
Is there any comparable tool for markdown (preferably pandoc-style markdown)?
Some static site generators that work with Markdown:
Jekyll is very popular and also the engine behind GitHub pages.
Python variants: Hyde or Pelican
nanoc (used f.ex. in the GitHub API documentation)
Middlemanapp: maybe the best one?
I think none of them use pandoc (maybe because it's written in Haskell), but they all use an enhanced Markdown syntax or can be configured to use pandoc.
Other interesting ways to generate a site from markdown:
Markdown-Wikis that are file based: f.ex. Gollum, the Wiki-Engine that is also used by GitHub
Telegram: commercial; written by David Pollak, the inventor the Lift-Scala-framework
Engines that use Pandoc:
Gitit: Pandoc Wiki
Hakyll: Haskell library to generate static sites
Pandoc-Plugin forIkiwiki
Yst static site generator
Gouda - generates a site from a directory of markdown files
Rippledoc - generates a navigable site from nested directories of markdown files
The definitive listing of Static Site Generators
A good overview of static site generators: http://staticsitegenerators.net/
Pandoc, the GNU make and sed commands, sprinkled with some CSS are all you need to fully automate the creation of a static website starting from Markdown.
Pandoc offers three command line options which can provide navigation between pages as well as the creation of a table of contents (TOC) based on the headings inside the page. With CSS you can make the navigation and TOC look and behave the way you want.
-B FILE, --include-before-body=FILE
Include contents of FILE, verbatim, at the beginning of the document body (e.g. after the tag in HTML, or the \begin{document} command in LaTeX). This can be used to include navigation bars or banners in HTML documents. This option can be used repeatedly to include multiple files. They will be included in the order specified. Implies --standalone.
--toc, --table-of-contents
Include an automatically generated table of contents.
--toc-depth=NUMBER
Specify the number of section levels to include in the table of contents.
The default is 3 (which means that level 1, 2, and 3 headers will be listed in the contents).
As a matter of fact, my personal website is built this way. Check out its makefile for more details. It is all free-libre open-source licensed under the GNU GPL version 3.
If you're OK not using Pandoc, mkdocs would seem to fit your needs.
If you definitely want to use Pandoc-flavoured Markdown, you could check out pdsite. I wrote it as a way to get mkdocs-style site generation with more input formats (like emacs org-mode) and without the Python dependencies - you pass in a folder of Markdown files and get out an HTML site (including automatically-generated multi-level navigation links). It's similar to Serge Stroobandt's approach in that it's just a shell script (it does require you to have tree installed however). Unfortunately it doesn't have a search function yet, although that wouldn't be too hard to add...

Is it possible to get the LESS parser to create a shared scope across multiple LESS files in link tags?

Sorry for the horrible question wording, let me explain.
For a project I'm working on, I'd like to manage various dependencies for my LESS files on the server. Because of the way the project is structured (different components symlinked in different ways), it's much more limiting to just use #import to build dependencies etc.
Ideally I'd like to just spit out a list of required LESS files in the section, e.g.:
<link rel='stylesheet/less' href='/path/to/some/file.less' type='text/css' media='all' />
<link rel='stylesheet/less' href='/path/to/some/other-file.less' type='text/css' media='all' />
Then, for example, if a variable or mixin is defined in file.less, I'd like to be able to use it in other-file.less.
From what I can tell, that doesn't work. Each LESS file seems to exist in its own scope and variables etc in one are not available in the other.
Is this correct? Is the scope entirely limited to a single file and any #imports therein? I'm reasonably sure that it is, but not entirely.
For now, my workaround is more complex than I'd like: I'm building dependencies server side, and then munging them into a giant, single development.less file on the fly. (Note that for production purposes, I have a build process that compiles and minifies my less so that I serve straight up CSS).
I've looked at browser.js in the LESS source code for clues but thought I'd ask here first if this was possible or even desirable. I was a bit surprised at this behavior since it's not how multiple javascript files and inline code work.
Why It Doesn't Work
Each <link> of a LESS file preprocesses that file and resolves it to just a plain CSS output. No variables or anything are left in the "scope" of the html itself, so there is nothing for the second <link> to be able to use. That is why one cannot read the other.
A Possible Help
With LESS 1.5 an #import can be made to just be a reference (and thus not compile direct output into the file). So your other-file.less could do this:
#import (reference) file.less;
To gain the dependencies needed for it.

Displaying only the similarities between 20 or so files?

Say I've got a directory full of html pages. Their headers and footers are basically the same, but I want to be able to see only the portions of all the pages that are the same. I'd like to call it an n-way merge, but that isn't what it is, it's looking for just the similarities between the header and the footers of all the files.
(and my header I don't mean just the <head> tag, but rather the portions of the page that are alike).
Note: There are like 20 html files.
Is there a name for a tool that does this?
If you are looking for what they have in common, you need a Clone detector.
Such a tool finds the common code fragments across an arbitrarily large
number of files and reports the commonality. A good one will discover
commonality based on target langauge structure in spite of white space changes, etc.,
e.g., it isn't comparing lines but rather copy-and-pasted structures.
I use ExamDiff

Duplicate content and keyword in URL

I observed that StackOverflow uses two types of links:
Should I list PDFs in my sitemap file?
and
Should I list PDFs in my sitemap file?
for the same question.
The idea is clear: add keywords into URL and have SE pick up the page faster.
But shouldn't Google punish for the duplicate content in this case?
I'm trying to understand what is more helpful since we have a similar situation on our site.
Source code has the answer.
<link rel="canonical" href="http://stackoverflow.com/questions/1072880/sitemap-xml">
<link rel="alternate" type="application/atom+xml" title="Feed for question 'Sitemap xml'" href="/feeds/question/1072880">
rel = alternate/canonical
The idea is clear: add keywords into
URL and have SE pick up the page
faster.
It actually has nothing to do with the speed of indexing, however, it does with ranking.
As pointed above, best approach when dealing with duplicated content inside the same domain is putting a canonical element pointing to the preferred URL.