remark-wiki-link
blog.johnnyreilly.com
remark-wiki-link | blog.johnnyreilly.com | |
---|---|---|
1 | 22 | |
85 | 34 | |
- | - | |
4.9 | 9.5 | |
7 months ago | 4 days ago | |
TypeScript | TypeScript | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
remark-wiki-link
-
Docusaurus 2.0 – Meta's static site generator to build documentation sites
Best I can tell, you'd need to use this wiki link plugin for the remark markdown processor: https://github.com/landakram/remark-wiki-link
blog.johnnyreilly.com
-
Migrating Azure Functions from JSDoc JavaScript to TypeScript
All of these affordances are available to me with TypeScript, and I want to keep them. Let's begin migrating. Incidentally, the code for this migration lies in this PR.
-
Playwright, GitHub Actions and Azure Static Web Apps staging environments
I'm going to write about this in the context of my blog. My blog is open source and you can find the code here. I'm going to present a simplified solution in this post, but you can find the full solution on GitHub.
-
Migrating from ts-node to Bun
These scripts are implemented as a simple ts-node console app. For historical reasons it's called trim-xml (it originally just truncated the sitemap.xml file). It's not a particularly good name but I'm not going to change it now. As the blog is open source, you can see the [code of trim-xml here](https://github.com/johnnyreilly/blog.johnnyreilly.com/tree/main/trim-xml].
-
Docusaurus blogs: adding breadcrumb Structured Data
I'm somewhat on the fence as to whether it's useful to have a breadcrumb for each tag. In fact, originally I didn't have it when I first added support. But I've added it in as it's not a lot of work and it's not a lot of code. I'm not sure if it's useful or not. I've added it now; I'm going to leave it in in place for a bit and see how it goes.
-
Serving Docusaurus images with Cloudinary
You will also need to disable the url-loader in your Docusaurus build which transforms images into base64 strings, as this will conflict with the plugin. There isn't a first class way to do this in Docusaurus at present. However by setting the environment variable WEBPACK_URL_LOADER_LIMIT to 0 you can disable it. You can see an implementation example in this pull request. It amounts to adding the cross-env package and then adding the following to your package.json:
//@ts-check const visit = require('unist-util-visit'); /** * Create a remark plugin that will replace image URLs with Cloudinary URLs * @param {*} options cloudName your Cloudinary’s cloud name eg demo, baseUrl the base URL of your website eg https://blog.johnnyreilly.com - should not include a trailing slash, will likely be the same as the config.url in your docusaurus.config.js * @returns remark plugin that will replace image URLs with Cloudinary URLs */ function imageCloudinaryRemarkPluginFactory( /** @type {{ cloudName: string; baseUrl: string }} */ options ) { const { cloudName, baseUrl } = options; const srcRegex = / src={(.*)}/; /** @type {import('unified').Plugin<[], import('hast').Root>} */ return function imageCloudinaryRemarkPlugin() { return (tree) => { visit(tree, ['element', 'jsx'], (node) => { if (node.type === 'element' && node['tagName'] === 'img') { // handles nodes like this: // { // type: 'element', // tagName: 'img', // properties: { // src: 'https://some.website.com/cat.gif', // alt: null // }, // ... // } const url = node['properties'].src; node[ 'properties' ].src = `https://res.cloudinary.com/${cloudName}/image/fetch/${url}`; } else if (node.type === 'jsx' && node['value']?.includes('')) { // handles nodes like this: // { // type: 'jsx', // value: '' // } const match = node['value'].match(srcRegex); if (match) { const urlOrRequire = match[1]; node['value'] = node['value'].replace( srcRegex, ` src={${`\`https://res.cloudinary.com/${cloudName}/image/fetch/${baseUrl}\$\{${urlOrRequire}\}\``}}` ); } } }); }; }; } module.exports = imageCloudinaryRemarkPluginFactory;
-
How I Ruined My SEO
yeah I'm hoping that my redirect story is now quite good - see dynamic redirect code here:
https://github.com/johnnyreilly/blog.johnnyreilly.com/blob/m...
as to the duplicate content, Docusaurus generates /tags/ and /pages/ content by default that I strip from from my sitemap manually.
-
How I ruined my SEO
I started using fontaine on my blog. If you haven't tried it out, you can find it here. It helps reduce Cumulative Layout Shift. The flash of unstyled content jank that you can see when you first land on a site, before fonts have loaded. I can't see why that would be an issue. It should improve my blogs Core Web Vitals and help stuff rank better, not worse. I think this is a red herring.
client side redirects boom * https://github.com/johnnyreilly/blog.johnnyreilly.com/commit/e641431314c4b6a19d375f1c7bc14f5bd6456ec9 november feedback loop
-
Using Application Insights with Bicep to monitor Azure Static Web Apps and Azure Functions
param location string param branch string param staticWebAppName string param tags object @secure() param repositoryToken string param rootCustomDomainName string param blogCustomDomainName string param appInsightsId string param appInsightsInstrumentationKey string param appInsightsConnectionString string var tagsWithHiddenLinks = union({ 'hidden-link: /app-insights-resource-id': appInsightsId 'hidden-link: /app-insights-instrumentation-key': appInsightsInstrumentationKey 'hidden-link: /app-insights-conn-string': appInsightsConnectionString }, tags) resource staticWebApp 'Microsoft.Web/staticSites@2022-03-01' = { name: staticWebAppName location: location tags: tagsWithHiddenLinks sku: { name: 'Free' tier: 'Free' } properties: { repositoryUrl: 'https://github.com/johnnyreilly/blog.johnnyreilly.com' repositoryToken: repositoryToken branch: branch provider: 'GitHub' stagingEnvironmentPolicy: 'Enabled' allowConfigFileUpdates: true buildProperties:{ skipGithubActionWorkflowGeneration: true } } } resource staticWebAppAppSettings 'Microsoft.Web/staticSites/config@2022-03-01' = { name: 'appsettings' kind: 'string' parent: staticWebApp properties: { APPINSIGHTS_INSTRUMENTATIONKEY: appInsightsInstrumentationKey APPLICATIONINSIGHTS_CONNECTION_STRING: appInsightsConnectionString } } resource staticWebAppFunctionAppSettings 'Microsoft.Web/staticSites/config@2022-03-01' = { name: 'functionappsettings' kind: 'string' parent: staticWebApp properties: { APPINSIGHTS_INSTRUMENTATIONKEY: appInsightsInstrumentationKey APPLICATIONINSIGHTS_CONNECTION_STRING: appInsightsConnectionString } } resource rootCustomDomain 'Microsoft.Web/staticSites/customDomains@2022-03-01' = { parent: staticWebApp name: rootCustomDomainName properties: {} } resource blogCustomDomain 'Microsoft.Web/staticSites/customDomains@2022-03-01' = { parent: staticWebApp name: blogCustomDomainName properties: {} } output staticWebAppDefaultHostName string = staticWebApp.properties.defaultHostname output staticWebAppId string = staticWebApp.id output staticWebAppName string = staticWebApp.name
What are some alternatives?
Docusaurus - Easy to maintain open source documentation websites.
ionic-docs
Oryx - Build your repo automatically.
notes - Collection of my byte sized notes on programming and other random topics.
mdBook - Create book from markdown files. Like Gitbook but implemented in Rust
fontaine - Automatic font fallback based on font metrics [Moved to: https://github.com/danielroe/fontaine]
content - Demisto is now Cortex XSOAR. Automate and orchestrate your Security Operations with Cortex XSOAR's ever-growing Content Repository. Pull Requests are always welcome and highly appreciated!
susam.net - Source code of https://susam.net/
core - 🔗 Remark plugin to convert URLs to embed code in markdown.
fontaine - Automatic font fallback based on font metrics [Moved to: https://github.com/unjs/fontaine]