diff --git a/helper/index.js b/helper/index.js index c4cd551..ff648fc 100644 --- a/helper/index.js +++ b/helper/index.js @@ -1,6 +1,6 @@ const browser = window.browser || window.chrome; export async function loadTemplates() { - return fetch(BASE_URL + "templates.json") + return fetch(BASE_URL + "templates.json" + "/raw?ref=master") .then((res) => res.json()) .then((res) => { browser.storage.local.set({ templates: res }); diff --git a/src/Template.jsx b/src/Template.jsx index 70844e7..2395da8 100644 --- a/src/Template.jsx +++ b/src/Template.jsx @@ -6,7 +6,7 @@ import { BadgeColors } from "../helper/index.js"; function Template({ author, language, name, published, src,local, onDelete }) { const [copyStatus, setCopyStatus] = React.useState(false); - const url = local ? src : BASE_URL + src; + const url = local ? src : BASE_URL + src + "/raw?ref=master"; const onCopy = () => { fetch(url) .then((res) => res.text()) diff --git a/webpack.prod.js b/webpack.prod.js index 855ad9c..8a20438 100644 --- a/webpack.prod.js +++ b/webpack.prod.js @@ -7,7 +7,7 @@ module.exports = merge(config, { plugins: [ new webpack.DefinePlugin({ BASE_URL: JSON.stringify( - "https://gitlab.com/neet3/Neet/-/raw/master/public/templates/" + "https://gitlab.com/api/v4/projects/51247610/repository/files/public%2Ftemplates%2F" ), }), new CopyPlugin({