You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2018/12/13 04:04:35 UTC

[GitHub] vogievetsky opened a new pull request #6731: Added titles and harmonized docs to improve usability and SEO

vogievetsky opened a new pull request #6731: Added titles and harmonized docs to improve usability and SEO
URL: https://github.com/apache/incubator-druid/pull/6731
 
 
   This PR:
   - Adds a title to every page (taken from the first header)
   - Also harmonized it so that the docs pages consistently use `# ...` notation instead of the `=======` underline
   - Standardizes each page to start with an `h1` and not `h2` because that makes sense
   - Removes extra new line after heredoc for consistency
   - Removed trailing spaces in every page I touched.
   
   This will solve this issue:
   
   ![image](https://user-images.githubusercontent.com/177816/49915034-7e029900-fe48-11e8-819a-8a0807e97954.png)
   
   which will increase usability because people like titles and also search engines like titles so it will boost SEO.
   
   Should solve: https://github.com/druid-io/druid-io.github.io/issues/545
   
   
   Note this is the script I used (for the record):
   
   `find docs/content -name "*.md" | xargs -n 1 node title-add.js`
   
   ```javascript
   const fs = require('fs');
   const file = process.argv[2]
   let cont = fs.readFileSync(file, 'utf-8');
   
   if (cont.includes("title: ")) return;
   
   let proc = cont;
   
   proc = proc.replace(
     /---\nlayout: doc_page\n---\n+#{1,2} (.+)\n+/m,
     '---\nlayout: doc_page\ntitle: "$1"\n---\n# $1\n\n'
   )
   
   proc = proc.replace(
     /---\nlayout: doc_page\n---\n+(.+)\n(-{4,99}|={4,99})\n+/m,
     '---\nlayout: doc_page\ntitle: "$1"\n---\n# $1\n\n'
   )
   
   if (proc === cont) {
     console.log('Leave:', file);
   } else {
     fs.writeFileSync(file, proc);
   }
   
   ```
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org