headers are now links
This commit is contained in:
		
							parent
							
								
									d0a833bc2e
								
							
						
					
					
						commit
						00d422f866
					
				
					 3 changed files with 48 additions and 6 deletions
				
			
		|  | @ -7,6 +7,7 @@ const hljs = require('highlight.js/lib/common'); | ||||||
| const { setup } = require('highlightjs-glimmer'); | const { setup } = require('highlightjs-glimmer'); | ||||||
| const markdownit = require('markdown-it'); | const markdownit = require('markdown-it'); | ||||||
| const markdownitClass = require('@toycode/markdown-it-class'); | const markdownitClass = require('@toycode/markdown-it-class'); | ||||||
|  | const anchor = require('markdown-it-anchor'); | ||||||
| const cheerio = require('cheerio'); | const cheerio = require('cheerio'); | ||||||
| 
 | 
 | ||||||
| const expectedInputFormat = 'YYYY-MM-DD'; | const expectedInputFormat = 'YYYY-MM-DD'; | ||||||
|  | @ -53,6 +54,9 @@ const md = markdownit({ | ||||||
|   } |   } | ||||||
| }); | }); | ||||||
| md.use(markdownitClass, markdownClassMapping); | md.use(markdownitClass, markdownClassMapping); | ||||||
|  | md.use(anchor, { | ||||||
|  |   permalink: anchor.permalink.headerLink() | ||||||
|  | }) | ||||||
| 
 | 
 | ||||||
| module.exports = function (eleventyConfig) { | module.exports = function (eleventyConfig) { | ||||||
|   let nunjucksEnvironment = new Nunjucks.Environment( |   let nunjucksEnvironment = new Nunjucks.Environment( | ||||||
|  |  | ||||||
							
								
								
									
										45
									
								
								package-lock.json
									
										
									
										generated
									
									
									
								
							
							
						
						
									
										45
									
								
								package-lock.json
									
										
									
										generated
									
									
									
								
							|  | @ -8,15 +8,13 @@ | ||||||
|       "name": "portfolio", |       "name": "portfolio", | ||||||
|       "version": "1.0.0", |       "version": "1.0.0", | ||||||
|       "license": "ISC", |       "license": "ISC", | ||||||
|       "dependencies": { |  | ||||||
|         "@toycode/markdown-it-class": "^1.2.4" |  | ||||||
|       }, |  | ||||||
|       "devDependencies": { |       "devDependencies": { | ||||||
|         "@11ty/eleventy": "^3.0.0", |         "@11ty/eleventy": "^3.0.0", | ||||||
|         "@11ty/eleventy-plugin-syntaxhighlight": "^3.1.3", |         "@11ty/eleventy-plugin-syntaxhighlight": "^3.1.3", | ||||||
|         "@catppuccin/highlightjs": "^1.0.1", |         "@catppuccin/highlightjs": "^1.0.1", | ||||||
|         "@catppuccin/tailwindcss": "^0.1.6", |         "@catppuccin/tailwindcss": "^0.1.6", | ||||||
|         "@divriots/jampack": "^0.23.3", |         "@divriots/jampack": "^0.23.3", | ||||||
|  |         "@toycode/markdown-it-class": "^1.2.4", | ||||||
|         "autoprefixer": "^10.3.7", |         "autoprefixer": "^10.3.7", | ||||||
|         "cheerio": "^1.0.0-rc.12", |         "cheerio": "^1.0.0-rc.12", | ||||||
|         "cssnano": "^5.0.8", |         "cssnano": "^5.0.8", | ||||||
|  | @ -24,6 +22,7 @@ | ||||||
|         "highlight.js": "^11.11.0", |         "highlight.js": "^11.11.0", | ||||||
|         "highlightjs-glimmer": "^2.2.1", |         "highlightjs-glimmer": "^2.2.1", | ||||||
|         "install": "^0.13.0", |         "install": "^0.13.0", | ||||||
|  |         "markdown-it-anchor": "^9.2.0", | ||||||
|         "npm": "^10.5.0", |         "npm": "^10.5.0", | ||||||
|         "npm-run-all": "^4.1.5", |         "npm-run-all": "^4.1.5", | ||||||
|         "postcss": "^8.3.11", |         "postcss": "^8.3.11", | ||||||
|  | @ -1682,6 +1681,7 @@ | ||||||
|       "version": "1.2.4", |       "version": "1.2.4", | ||||||
|       "resolved": "https://registry.npmjs.org/@toycode/markdown-it-class/-/markdown-it-class-1.2.4.tgz", |       "resolved": "https://registry.npmjs.org/@toycode/markdown-it-class/-/markdown-it-class-1.2.4.tgz", | ||||||
|       "integrity": "sha512-hA4gHBK8moObkOYdWTjhy1wYcYy0MJeM3JjSKbsXHRpRMvIKhk6Jm+t3bXsSScTdz/byWqQbs8YIwVYjHp+SlQ==", |       "integrity": "sha512-hA4gHBK8moObkOYdWTjhy1wYcYy0MJeM3JjSKbsXHRpRMvIKhk6Jm+t3bXsSScTdz/byWqQbs8YIwVYjHp+SlQ==", | ||||||
|  |       "dev": true, | ||||||
|       "license": "MIT" |       "license": "MIT" | ||||||
|     }, |     }, | ||||||
|     "node_modules/@trysound/sax": { |     "node_modules/@trysound/sax": { | ||||||
|  | @ -1694,6 +1694,34 @@ | ||||||
|         "node": ">=10.13.0" |         "node": ">=10.13.0" | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|  |     "node_modules/@types/linkify-it": { | ||||||
|  |       "version": "5.0.0", | ||||||
|  |       "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-5.0.0.tgz", | ||||||
|  |       "integrity": "sha512-sVDA58zAw4eWAffKOaQH5/5j3XeayukzDk+ewSsnv3p4yJEZHCCzMDiZM8e0OUrRvmpGZ85jf4yDHkHsgBNr9Q==", | ||||||
|  |       "dev": true, | ||||||
|  |       "license": "MIT", | ||||||
|  |       "peer": true | ||||||
|  |     }, | ||||||
|  |     "node_modules/@types/markdown-it": { | ||||||
|  |       "version": "14.1.2", | ||||||
|  |       "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-14.1.2.tgz", | ||||||
|  |       "integrity": "sha512-promo4eFwuiW+TfGxhi+0x3czqTYJkG8qB17ZUJiVF10Xm7NLVRSLUsfRTU/6h1e24VvRnXCx+hG7li58lkzog==", | ||||||
|  |       "dev": true, | ||||||
|  |       "license": "MIT", | ||||||
|  |       "peer": true, | ||||||
|  |       "dependencies": { | ||||||
|  |         "@types/linkify-it": "^5", | ||||||
|  |         "@types/mdurl": "^2" | ||||||
|  |       } | ||||||
|  |     }, | ||||||
|  |     "node_modules/@types/mdurl": { | ||||||
|  |       "version": "2.0.0", | ||||||
|  |       "resolved": "https://registry.npmjs.org/@types/mdurl/-/mdurl-2.0.0.tgz", | ||||||
|  |       "integrity": "sha512-RGdgjQUZba5p6QEFAVx2OGb8rQDL/cPRG7GiedRzMcJ1tYnUANBncjbSB1NRGwbvjcPeikRABz2nshyPk1bhWg==", | ||||||
|  |       "dev": true, | ||||||
|  |       "license": "MIT", | ||||||
|  |       "peer": true | ||||||
|  |     }, | ||||||
|     "node_modules/a-sync-waterfall": { |     "node_modules/a-sync-waterfall": { | ||||||
|       "version": "1.0.1", |       "version": "1.0.1", | ||||||
|       "resolved": "https://registry.npmjs.org/a-sync-waterfall/-/a-sync-waterfall-1.0.1.tgz", |       "resolved": "https://registry.npmjs.org/a-sync-waterfall/-/a-sync-waterfall-1.0.1.tgz", | ||||||
|  | @ -5451,6 +5479,17 @@ | ||||||
|         "markdown-it": "bin/markdown-it.mjs" |         "markdown-it": "bin/markdown-it.mjs" | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|  |     "node_modules/markdown-it-anchor": { | ||||||
|  |       "version": "9.2.0", | ||||||
|  |       "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-9.2.0.tgz", | ||||||
|  |       "integrity": "sha512-sa2ErMQ6kKOA4l31gLGYliFQrMKkqSO0ZJgGhDHKijPf0pNFM9vghjAh3gn26pS4JDRs7Iwa9S36gxm3vgZTzg==", | ||||||
|  |       "dev": true, | ||||||
|  |       "license": "Unlicense", | ||||||
|  |       "peerDependencies": { | ||||||
|  |         "@types/markdown-it": "*", | ||||||
|  |         "markdown-it": "*" | ||||||
|  |       } | ||||||
|  |     }, | ||||||
|     "node_modules/markdown-it/node_modules/argparse": { |     "node_modules/markdown-it/node_modules/argparse": { | ||||||
|       "version": "2.0.1", |       "version": "2.0.1", | ||||||
|       "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", |       "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", | ||||||
|  |  | ||||||
|  | @ -34,6 +34,7 @@ | ||||||
|     "@catppuccin/highlightjs": "^1.0.1", |     "@catppuccin/highlightjs": "^1.0.1", | ||||||
|     "@catppuccin/tailwindcss": "^0.1.6", |     "@catppuccin/tailwindcss": "^0.1.6", | ||||||
|     "@divriots/jampack": "^0.23.3", |     "@divriots/jampack": "^0.23.3", | ||||||
|  |     "@toycode/markdown-it-class": "^1.2.4", | ||||||
|     "autoprefixer": "^10.3.7", |     "autoprefixer": "^10.3.7", | ||||||
|     "cheerio": "^1.0.0-rc.12", |     "cheerio": "^1.0.0-rc.12", | ||||||
|     "cssnano": "^5.0.8", |     "cssnano": "^5.0.8", | ||||||
|  | @ -41,14 +42,12 @@ | ||||||
|     "highlight.js": "^11.11.0", |     "highlight.js": "^11.11.0", | ||||||
|     "highlightjs-glimmer": "^2.2.1", |     "highlightjs-glimmer": "^2.2.1", | ||||||
|     "install": "^0.13.0", |     "install": "^0.13.0", | ||||||
|  |     "markdown-it-anchor": "^9.2.0", | ||||||
|     "npm": "^10.5.0", |     "npm": "^10.5.0", | ||||||
|     "npm-run-all": "^4.1.5", |     "npm-run-all": "^4.1.5", | ||||||
|     "postcss": "^8.3.11", |     "postcss": "^8.3.11", | ||||||
|     "postcss-cli": "^9.0.1", |     "postcss-cli": "^9.0.1", | ||||||
|     "tailwindcss": "^3.4.17", |     "tailwindcss": "^3.4.17", | ||||||
|     "tailwindcss-animated": "^1.0.1" |     "tailwindcss-animated": "^1.0.1" | ||||||
|   }, |  | ||||||
|   "dependencies": { |  | ||||||
|     "@toycode/markdown-it-class": "^1.2.4" |  | ||||||
|   } |   } | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Ava Gaiety W
						Ava Gaiety W