diff options
| author | jackyzha0 <[email protected]> | 2020-09-17 00:24:49 -0700 |
|---|---|---|
| committer | jackyzha0 <[email protected]> | 2020-09-17 00:24:49 -0700 |
| commit | 112429676a36fd88aed3e0558faf23ecb4a678ac (patch) | |
| tree | 50bac163e56558325422f2b0342804a10d59a9a2 /frontend/src | |
| parent | Merge pull request #58 from jackyzha0/patch (diff) | |
| download | ctrl-v-112429676a36fd88aed3e0558faf23ecb4a678ac.tar.xz ctrl-v-112429676a36fd88aed3e0558faf23ecb4a678ac.zip | |
set default for md and latex to renderer, add title and description setting in pasteview
Diffstat (limited to 'frontend/src')
| -rw-r--r-- | frontend/src/components/ViewPaste.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/frontend/src/components/ViewPaste.js b/frontend/src/components/ViewPaste.js index 179321b..b2e1ba5 100644 --- a/frontend/src/components/ViewPaste.js +++ b/frontend/src/components/ViewPaste.js @@ -7,6 +7,7 @@ import PasswordModal from './modals/PasswordModal' import { FetchPaste, FetchPasswordPaste } from '../helpers/httpHelper' import { LANGS } from './renderers/Code' import RenderDispatch from './renderers/RenderDispatch' +import MetaTags from 'react-meta-tags'; function fmtDateStr(dateString) { const d = new Date(dateString) @@ -22,7 +23,7 @@ const ViewPaste = (props) => { const [validPass, setValidPass] = useState(false); const [expiry, setExpiry] = useState(''); const [theme, setTheme] = useState('atom'); - const [isRenderMode, setIsRenderMode] = useState(false); + const [isRenderMode, setIsRenderMode] = useState(true); const [language, setLanguage] = useState(LANGS.raw); const ErrorLabelRef = useRef(null); @@ -54,6 +55,7 @@ const ViewPaste = (props) => { } function setStateFromData(data) { + document.title = data.title setTitle(data.title) setContent(data.content) setLanguage(data.language) @@ -114,6 +116,10 @@ const ViewPaste = (props) => { return ( <div> + <MetaTags> + <meta name="description" content={`${language}, expires ${expiry}. hosted on ctrl-v`} /> + <meta property="og:title" content={title} /> + </MetaTags> <PasswordModal hasPass={hasPass} validPass={validPass} |