As a website content expert who deeply understands the operation of AnQiCMS, I have a very good understanding of the importance of efficient content creation tools for the success of a website.Markdown editors are increasingly favored by content creators for their simplicity and efficiency.AnQiCMS deeply integrates Markdown editor and provides rich extension functions, making your content publishing more convenient.This article will elaborate on how to modify the Markdown editor settings in the AnQiCMS backend and ensure that these settings take effect immediately upon content publication.
Enable Markdown Editor: The New Starting Point for Content Creation
Enabling Markdown editor in AnQiCMS is the first step to start efficient content creation.This setting does not exist independently, but is integrated into the system's 'Content Settings' module.To make this adjustment, you need to log in to your AnQiCMS admin interface first.
Once logged in, please find and click on the 'Background Settings' in the left navigation bar, and then select 'Content Settings'.On this page, you will see a series of options related to website content processing.Please carefully find the option named "Enable Markdown Editor".This is usually a switch or checkbox, just switch its state to 'enable'.This operation will directly affect the editor type you use when publishing or editing articles, products, pages, and other content.After enabling, you will be able to experience the convenience of Markdown syntax when creating or modifying content.
Strengthen Front-end Display: Perfect Presentation of Styles, Mathematical Formulas, and Flowcharts
Only the Markdown editor has been enabled in the background, and it cannot be guaranteed that your Markdown content will be presented in the front-end of the website.Especially when your content involves complex mathematical formulas or flowcharts, the correct rendering on the front-end page requires additional integration.AnQiCMS provides support for these advanced features, but you need to manually include the corresponding styles and scripts.
To make Markdown content on your website have a professional display effect, especially in scenarios involving mathematical formulas and flowcharts, you need to make some modifications to the front-end template files. Typically, the core template files likebase.htmlIt is the ideal place to make such global changes.
Firstly, to make Markdown content clear and easy to read, we recommend introducinggithub-markdown-css. You can usebase.htmlthe file<head>Add the following code inside the tag to load this stylesheet using a CDN:
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/5.2.0/github-markdown.min.css" crossorigin="anonymous" referrerpolicy="no-referrer" />
Next, if your content contains mathematical formulas, you need to integrate the MathJax library to ensure they are correctly parsed and displayed. Similarly,base.htmlof<head>Within the tag, add the MathJax script:
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
Finally, for process diagrams that need to be dynamically rendered on the page (such as process diagrams created using Mermaid syntax), you also need to include the Mermaid library. It is recommended that youbase.htmlthe file<body>Before the tag, or on the page where the flowchart needs to be rendered<script>Add the following code in the tag
<script type="module">
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs';
mermaid.initialize({ startOnLoad: true });
</script>
The introduction of these frontend codes will empower your AnQiCMS website with powerful Markdown content rendering capabilities, ensuring that your high-quality content is presented to readers in the most professional and intuitive manner.
Save and verify: Ensure new settings take effect immediately
After you have completed the switch of the Markdown editor status and the modification of the front-end template files, the crucial step is to save these changes and verify whether they take effect.
For the "Content SettingsPlease make sure to click this button to persist your settings to the system.Once saved successfully, the system will immediately apply this new configuration.For modifying the front-end template files, you just need to save the corresponding file.
However, simply saving a file sometimes does not make the changes visible on the front end immediately.This is because the browser or AnQiCMS system may have a cache.
First, access the "Update Cache" function in the AnQiCMS admin panel.This is usually located in a prominent position in the left navigation bar, clicking it can clear the system cache to ensure that the latest configuration and template files are loaded.Secondly, it is strongly recommended that you clear your browser cache.Ctrl + F5(Windows/Linux) orCmd + Shift + R(Mac) Perform a hard refresh, which will force the browser to reload all page resources instead of using local cache.
Frequently Asked Questions (FAQ)
Q1: Why did I enable the Markdown editor in the background, but there are no Markdown styles and features when the content is displayed on the front end?A: Enable Markdown editor only in the background, which will only change your content editing experience. To ensure that Markdown content is rendered correctly on the front page, especially for displaying mathematical formulas and flowcharts, you will also need to manually modify the front-end template files (usuallybase.html)。You need to introducegithub-markdown-cssThe stylesheet, along with JavaScript libraries such as MathJax and Mermaid, allows the browser to correctly parse and beautify the display of advanced elements in Markdown content.
Q2: Can I use a Markdown editor for some articles while using a traditional rich text editor for others?A: Currently, the AnQiCMS Markdown editor settings are global.Once enabled in the "Content Settings", all new or edited articles will default to using the Markdown editor.The current version of the system does not provide the function to switch the editor type for a single article.This means you need to standardize the format of content creation, or manually convert Markdown content to HTML format (if your frontend does not load a Markdown renderer)
Q3: If I have already published a lot of Markdown content, will my content be affected now that the Markdown editor has been disabled?A: If you disable the Markdown editor, the content editing interface in the background will switch back to the traditional rich text mode.But the rendering effect of the published Markdown content on the front end will depend on whether the CSS styles and JavaScript libraries required for Markdown rendering are still loaded in your front-end template file.## 标题or*斜体*May be displayed directly as plain text with prefixes or symbols, thereby affecting the reading experience.Therefore, before disabling the Markdown editor, make sure you have assessed the impact on existing content.