1
0
mirror of https://github.com/go-task/task.git synced 2024-12-12 10:45:49 +02:00

chore(website): reactivate carbon

This commit is contained in:
Andrey Nering 2023-08-09 20:47:43 -03:00
parent 90a8c26b25
commit 2b21fd2eda
6 changed files with 114 additions and 1 deletions

View File

@ -96,7 +96,10 @@ const getConfig = async () => {
},
blog: false,
theme: {
customCss: [require.resolve('./src/css/custom.css')]
customCss: [
require.resolve('./src/css/custom.css'),
require.resolve('./src/css/carbon.css')
]
},
gtag: {
trackingID: 'G-4RT25NXQ7N',
@ -111,6 +114,13 @@ const getConfig = async () => {
]
],
scripts: [
{
src: '/js/carbon.js',
async: true
}
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({

View File

@ -6,6 +6,10 @@ const sidebars = {
{
type: 'autogenerated',
dirName: '.'
},
{
type: 'html',
value: '<div id="sidebar-ads"></div>'
}
]
};

65
docs/src/css/carbon.css Normal file
View File

@ -0,0 +1,65 @@
#carbonads * {
margin: initial;
padding: initial;
}
#carbonads {
display: flex;
max-width: 330px;
background-color: hsl(0, 0%, 98%);
box-shadow: 0 1px 4px 1px hsla(0, 0%, 0%, 0.1);
z-index: 100;
}
#carbonads a {
color: inherit;
text-decoration: none;
}
#carbonads a:hover {
color: inherit;
}
#carbonads span {
position: relative;
display: block;
overflow: hidden;
}
#carbonads .carbon-wrap {
display: flex;
}
#carbonads .carbon-img {
display: block;
margin: 0;
line-height: 1;
}
#carbonads .carbon-img img {
display: block;
}
#carbonads .carbon-text {
font-size: 13px;
padding: 10px;
margin-bottom: 16px;
line-height: 1.5;
text-align: left;
}
#carbonads .carbon-poweredby {
display: block;
padding: 6px 8px;
background: #f1f1f2;
text-align: center;
text-transform: uppercase;
letter-spacing: 0.5px;
font-weight: 600;
font-size: 8px;
line-height: 1;
border-top-left-radius: 3px;
position: absolute;
bottom: 0;
right: 0;
}
[data-theme='dark'] #carbonads {
background-color: hsl(0, 0%, 35%);
box-shadow: 0 1px 4px 1px hsl(0, 0%, 55%);
}
[data-theme='dark'] #carbonads .carbon-poweredby {
background-color: hsl(0, 0%, 55%);
}

View File

@ -63,6 +63,11 @@
width: 100%;
}
#carbonads {
margin-top: 30px;
margin-right: 10px;
}
.gold-sponsors {
display: flex;
justify-content: center;

View File

29
docs/static/js/carbon.js vendored Normal file
View File

@ -0,0 +1,29 @@
(function () {
function attachAd() {
var el = document.createElement('script');
el.setAttribute('type', 'text/javascript');
el.setAttribute('id', '_carbonads_js');
el.setAttribute(
'src',
'//cdn.carbonads.com/carbon.js?serve=CESI65QJ&placement=taskfiledev'
);
el.setAttribute('async', 'async');
var wrapper = document.getElementById('sidebar-ads');
wrapper.innerHTML = '';
wrapper.appendChild(el);
}
setTimeout(function () {
attachAd();
var currentPath = window.location.pathname;
setInterval(function () {
if (currentPath !== window.location.pathname) {
currentPath = window.location.pathname;
attachAd();
}
}, 1000);
}, 1000);
})();