Improved SEO (meta tags support)
Les mainteneurs répondent en général sous 2 jours
@anikethsaha y travaille déjà.
Depuis le 23/6/2020.
Évaluation
Cette issue n'a pas encore été évaluée.
Description
Feature request
What problem does this feature solve?
It improves SEO of pages generated by Docsify. It makes it easier for search engines to find the relevant content, and when a user shares a link to a Docsify page, the rendered preview is more accurate (title, description and image).
Example (diff pages, same SEO 😢 ):
What does the proposed API look like?
Marp allows you to write slides using Markdown, and each file has a small header like this:
---
marp: true
title: Marp CLI example
description: Hosting Marp slide deck on the web
theme: uncover
paginate: true
---
Docsify could have something similar that would allow us to define the meta tags of each page. Example:
---
<!-- Primary Meta Tags -->
meta-title: Site title: Page title
meta-description: This is the summary that appears on search engine results or preview links
<!-- Open Graph -->
meta-og-type:
meta-og-url:
meta-og-title:
meta-og-description:
meta-og-image: https://yourdomain.com/path/to/image.jpg
<!-- Twitter -->
meta-twitter-card:
meta-twitter-url:
meta-twitter-title:
meta-twitter-description:
meta-twitter-image: https://yourdomain.com/path/to/image.jpg
---
# Page title
And the _rest_ of the page.
- I think a syntax like this would be good enough for us. I would say the first two fields are the MVP, as that works everywhere.
- Then Open Graph would be helpful, because it allows you to define an image.
- And finally, with the lowest priority/importance, the Twitter meta tags, because if Twitter can't find them it will fallback to the Open Graph tags.
How should this be implemented in your opinion?
I checked if it was possible to hack it with the current Docsify version by hardcoding HTML tags in the .md file.
<!-- markdownlint-disable MD033 -->
<!-- SEO tags -->
<title>(TITLE) (SEPARATOR) Title of this page</title>
<meta name="title" content="(TITLE) (SEPARATOR) Title of this page">
<meta name="description" content="A description that is specific to this page.">
# TITLE_HERE

It didn't work. Those tags were added inside <body> ... <article>, but we need them to exist in the <head> section.
I propose this flow:
- When Docsify reads a Markdown file, it checks if it has a header.
- If it doesn't, then everything works as is.
- If it has, it will read each key (e.g.
meta-title) and override it's value.
Example:
Docsify detects a header. One key is
meta-dummy. Docsify doesn't know how to handle this key, so it skips it. The next key ismeta-title. Docsify knows how to handle this, so it goes tohead.meta.titleand replaces the default value with the value in the file header.
Are you willing to work on this yourself?
I don't think I have enough JS and Docsify knowledge to develop this feature. But I can (beta) test it!
- Langage dominant
- JavaScript
- Étoiles
- 31.5k
- Forks
- 5.8k
- Merge moyen
- 2 j 14 h
- PR mergées (30 j)
- 5
Préparer son environnement
- Fournit un Dockerfile ou un fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de docsifyjs/docsify
-
Query parameter values are truncated at a second equals signPeut-être pris @xu91102 l’a pris il y a 23 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
Les mainteneurs répondent en général sous 2 jours
-
Bullet points beginning with inline math: subsequent text formatting not recognised correctlyOuvertebug Triage
Difficulté 3/5 1-2 jours Accessibilité débutants 66/100
Les mainteneurs répondent en général sous 2 jours
-
Cached AJAX responses lose status metadata exposed through vm.route.responsePeut-être pris @xu91102 l’a pris il y a 23 jours. Ouverte
Difficulté 3/5 1-2 jours Accessibilité débutants 68/100
Les mainteneurs répondent en général sous 2 jours
-
In the Edge browser, the character `{docsify-updated}` is not replacedPeut-être à nouveau libre @AmanUllah687 l’a pris il y a 76 jours, et aucune pull request n’est ouverte. Ouvertewait for information
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
docsifyjs/docsify#2681 · 11 commentaires ·
Les mainteneurs répondent en général sous 2 jours
-
Nested/Recursive includesOuvertefeature request Triage
Difficulté 4/5 3-5 jours Accessibilité débutants 38/100
docsifyjs/docsify#2643 · 5 commentaires ·
Les mainteneurs répondent en général sous 2 jours
Toutes les issues de docsifyjs/docsify
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 67/100
taskcluster/taskcluster#9284 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Xvesa 24bbp incorrect info?Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Spomky-Labs/pwa-bundle#476 ·
-
[feart] 支持 MiMo 类型模型的关闭思考识别Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
speced/respec#5504 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour