前言
Settings in Lightweight CMS work as parameters to modify Lightweight CMS sites. This article illustrates those settings.
不同類別的設置
There are three categories of settings in Lightweight CMS. Project settings are used by Lightweight CMS itself, theme settings used by Lightweight CMS themes and plugin settings used by Lightweight CMS plugins.
You should not remove project settings because either internal library or utility scripts of Lightweight CMS rely on those constants to work properly. In contrary, theme settings and plugin settings are optional. Current theme settings are used by default theme of Lightweight CMS. You may use a different set of theme settings in another Lightweight CMS theme.
站台資訊
SITE_BASE_URL(project): The base URL of a siteSITE_PREFIX(project): The prefix of a site. Used for a subsite.SITE_NAME(project): The full name of a siteSITE_SHORT_NAME(project): The short name of a siteSITE_DESCRIPTION(project): A concise description of a siteSITE_AUTHOR(project): The principle author of a siteSITE_COPYRIGHT(theme): The copyright text of a siteSITE_LANGUAGE(project): The language code used in a site. Look up a valid language code hereSITE_THEME(project): Theme used by a siteSITE_LOGO(project): File name of site logo without size suffix and file extension. Default file format of site logo isimage/png
SITE_AUTHOR is default author of a Lightweight CMS site. You may set a author of a post other than SITE_AUTHOR in its metadata.
社群媒體
FACEBOOK(theme): Personal Facebook account or Facebook fan pageFACEBOOK_GROUP(theme): Facebook groupTWITTER(theme): Twitter accountGITHUB(theme): Personal GitHub account or a GitHub project
站台參數
REDIRECT_LIST(project): A list of redirecting rulesPLUGIN_BLACKLIST(project): A blacklist to prevent plugin(s) from loadingBREADCRUMB_HOME(project): Text used by home page on breadcrumbsEXCERPT_THRESHOLD(plugin): Text amount for an excerpt of a postTHEME_COLOR(theme):theme-colorin<meta>tagSCRIPT_DIRECTION(project): the script direction of the main language of your siteSITE_ORIENTATION(project): the orientation of a site or a web application
可選擇特性
ENABLE_PWA(theme): Enable PWA (progressive web application) related featuresENABLE_TOC(theme): Enable ToC (table of contents) on sidebars of postsENABLE_FIXED_SIDEBAR(theme): Enable fixed sidebarsENABLE_CODE_HIGHTLIGHT(theme): Enable code highlighting powered by hightlightjsBLOCK_BOT_ON_SECTION(theme): Prevent search engine bots from crawling sectionsNO_FOLLOW_EXTERNAL_LINK(project): Prevent search engine bots from following external linksLOAD_SITE_ASSETS(project): Enable to load site assetsGOOGLE_ANALYTICS_ID(plugin): Set the id of Google Analytics 4
排序回呼函式
$GLOBALS[SORT_SECTION_CALLBACK](project): Callback used to sort sections$GLOBALS[SORT_POST_CALLBACK](project): Callback used to sort posts
See this article for information on writing sorting callbacks for sections and posts.
內部參數
Lightweight CMS is flexible by design. Although these internal settings are seldom modified by end users, you may modify them to fit your own need.
章節用文件檔
SECTION_INDEX(project): Posts for sections
專案結構
CONTENT_DIRECTORY(project): Path of content directoryTHEME_DIRECTORY(project): Path of themes directoryPLUGIN_DIRECTORY(project): Path of plugins directoryASSET_DIRECTORY(project): Path of assets directoryLIBRARY_DIRECTORY(project): Path of src directoryAPPLICATION_DIRECTORY(project): Path of www directoryPUBLIC_DIRECTORY(project): Path of public directory
章節和文章的元資料
METADATA_TITLE(project): The field of titles in metadataMETADATA_AUTHOR(project): The Field of authors in metadataMETADATA_MTIME(project): The field of last modified time in metadataMETADATA_WEIGHT(project): The field of user-defined values for sorting in metadataMETADATA_NOINDEX(project): The field to prevent search engine bots from crawlingMETADATA_DRAFT(project): The field to set the status of a post as a draft
文檔的副檔名
HTML_FILE_EXTENSION(project): The file extension used for HTML postsMARKDOWN_FILE_EXTENSION(project): The file extension used for Markdown postsASCIIDOC_FILE_EXTENSION(project): The file extension used for AsciiDoc postsRESTRUCTUREDTEXT_FILE_EXTENSION(project): The file extension used for reStructuredText posts
自行新增特性
In addition to current settings used by Lightweight CMS, you may add you own as needed.