diff --git a/.gitignore b/.gitignore index c450f48..78f1d86 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ mycorrhiza +demo diff --git a/cfg/config.go b/cfg/config.go index e4eb3b0..548d5d7 100644 --- a/cfg/config.go +++ b/cfg/config.go @@ -43,6 +43,9 @@ var ( TelegramEnabled bool TelegramBotToken string TelegramBotName string + + ReplaceFrom []string + ReplaceTo []string ) // WikiDir is a full path to the wiki storage directory, which also must be a @@ -59,6 +62,8 @@ type Config struct { Authorization CustomScripts `comment:"You can specify additional scripts to load on different kinds of pages, delimited by a comma ',' sign."` Telegram `comment:"You can enable Telegram authorization. Follow these instructions: https://core.telegram.org/widgets/login#setting-up-a-bot"` + ReplaceFrom []string + ReplaceTo []string } // Hyphae is a section of Config which has fields related to special hyphae. @@ -191,6 +196,8 @@ func ReadConfigFile(path string) error { TelegramBotToken = cfg.TelegramBotToken TelegramBotName = cfg.TelegramBotName TelegramEnabled = (TelegramBotToken != "") && (TelegramBotName != "") + ReplaceFrom = cfg.ReplaceFrom + ReplaceTo = cfg.ReplaceTo // This URL makes much more sense. If no URL is set or the protocol is forgotten, assume HTTP. if URL == "" { diff --git a/l18n/en/auth.json b/l18n/en/auth.json index 307420a..39d728a 100644 --- a/l18n/en/auth.json +++ b/l18n/en/auth.json @@ -18,7 +18,7 @@ "lock_title": "Locked", "password_tip": "The server stores your password in an encrypted form; even administrators cannot read it.", - "cookie_tip": "By submitting this form you give this wiki a permission to store cookies in your browser. It lets the engine associate your edits with you. You will stay logged in until you log out.", + "cookie_tip": "By submitting this form you give this wiki your soul, thoughts and mind. It lets the engine associate your edits with you. You will stay logged in until you log out.", "telegram_tip": "You can log in using Telegram. It only works if you have set your @username in Telegram and this username is free on this wiki.", "noauth": "Authentication is disabled. You can make edits anonymously.", diff --git a/l18n/en/ui.json b/l18n/en/ui.json index 8350b05..b68427d 100644 --- a/l18n/en/ui.json +++ b/l18n/en/ui.json @@ -11,47 +11,47 @@ "delete_link": "Delete", "text_link": "View markup", "media_link": "Manage media", - "media_link_for_textual": "Turn to media hypha", + "media_link_for_textual": "Turn to media page", "backlinks_link": "{{.n}} backlink%s", "backlinks_link+one": "", "backlinks_link+other": "s", - "subhyphae": "Subhyphae", + "subhyphae": "Subpages", - "random_no_hyphae": "There are no hyphae", - "random_no_hyphae_tip": "It is impossible to display a random hypha because the wiki does not contain any hyphae", + "random_no_hyphae": "There are no pages", + "random_no_hyphae_tip": "It is impossible to display a random page because the wiki does not contain any pages", "error": "Error", "error_text_fetch": "Could not fetch text data", "error_try_again": "Try again", - "error_go_back": "Go back to the hypha.", + "error_go_back": "Go back to the page.", "ask_rename": "Rename %s", "rename_to": "New name", - "rename_recurse": "Rename subhyphae too", - "rename_tip": "If you rename this hypha, all incoming links and all relative outcoming links will break. You will also lose all history for the new name. Rename carefully.", + "rename_recurse": "Rename subpages too", + "rename_tip": "If you rename this page, all incoming links and all relative outcoming links will break. You will also lose all history for the new name. Rename carefully.", "rename_taken": "Name taken", - "rename_taken_tip": "Hypha named {{.name}} already exists, cannot rename", + "rename_taken_tip": "page named {{.name}} already exists, cannot rename", "rename_noname": "No name given", "rename_noname_tip": "No new name is given", "rename_badname": "Invalid name", "rename_badname_tip": "Invalid new name. Names cannot contain characters {{.chars}}.", "act_no_media": "No media", - "act_no_media_tip": "Cannot remove media because this is not a media hypha", + "act_no_media_tip": "Cannot remove media because this is not a media page", "act_norights": "Not enough rights", "act_notexist": "Does not exist", "act_norights_delete": "Not enough rights to delete, you must be a moderator", - "act_notexist_delete": "Cannot delete this hypha because it does not exist", + "act_notexist_delete": "Cannot delete this page because it does not exist", "act_norights_rename": "Not enough rights to rename, you must be a trusted editor", - "act_notexist_rename": "Cannot rename this hypha because it does not exist", + "act_notexist_rename": "Cannot rename this page because it does not exist", "act_norights_remove_media": "Not enough rights to remove media, you must be a trusted editor", - "act_notexist_remove_media": "Cannot remove media because this hypha does not exist", - "act_norights_edit": "You must be an editor to edit a hypha", + "act_notexist_remove_media": "Cannot remove media because this page does not exist", + "act_norights_edit": "You must be an editor to edit a page", "act_norights_upload_media": "You must be an editor to upload media", "ask_remove_media": "Remove media from %s?", - "ask_really": "Do you really want to {{.verb}} hypha {{.name}}?", + "ask_really": "Do you really want to {{.verb}} page {{.name}}?", "ask_delete_verb": "delete", "ask_remove_media_verb": "remove_media", @@ -60,14 +60,14 @@ "revision_title": "{{.name}} at {{.rev}}", "revision_warning": "Please note that viewing media is not supported in history for now.", "revision_link": "Get Mycomarkup source of this revision", - "revision_no_text": "This hypha had no text at this revision.", + "revision_no_text": "This page had no text at this revision.", "about_title": "About {{.name}}", "users_title": "User list", "no_rights": "Not enough rights", - "reindex_no_rights": "You must be an admin to reindex hyphae.", + "reindex_no_rights": "You must be an admin to reindex pages.", "header_no_rights": "You must be a moderator to update header links.", "media_download": "Download media", @@ -77,8 +77,8 @@ "media_noaudio_link": "Download audio", "media_title": "Media of {{.name}}", - "media_empty": "This hypha has no media, you can upload it here.", - "media_tip": "You can manage the hypha's media on this page.", + "media_empty": "This page has no media, you can upload it here.", + "media_tip": "You can manage the page's media on this page.", "media_what_is": "What is media?", "media_upload": "Upload", "media_stat": "Stat", @@ -88,7 +88,7 @@ "media_size_value+other": "s", "media_stat_mime": "MIME type:", "media_include": "Include", - "media_include_tip": "This media is an image. To include it in a hypha, use a syntax like this:", + "media_include_tip": "This media is an image. To include it in a page, use a syntax like this:", "media_new": "media", "media_new_tip": "You can upload a new media. Please do not upload too big pictures unless you need to because may not want to wait for big pictures to load.", "media_remove": "Remove media", diff --git a/mimetype/mime.go b/mimetype/mime.go index ac5bbff..7b673a4 100644 --- a/mimetype/mime.go +++ b/mimetype/mime.go @@ -50,6 +50,8 @@ var mapMime2Ext = map[string]string{ "video/webm": "webm", "audio/mp3": "mp3", "video/mp4": "mp4", + "application/pdf": "pdf", + "audio/mpeg": "mp3", } var mapExt2Mime = map[string]string{ @@ -65,4 +67,5 @@ var mapExt2Mime = map[string]string{ ".webm": "video/webm", ".mp3": "audio/mp3", ".mp4": "video/mp4", + ".pdf": "application/pdf", } diff --git a/mycoopts/view.qtpl b/mycoopts/view.qtpl index 935e4de..cfc43e4 100644 --- a/mycoopts/view.qtpl +++ b/mycoopts/view.qtpl @@ -28,7 +28,7 @@
{%s lc.Get("ui.media_noaudio") %} {%s lc.Get("ui.media_noaudio_link") %}
- + {% default %}