Comments (4)
index.js:
import MyResume from './assets/sam-poe-resume.pdf';
...
function addResume(MyResume){
const elements = document.getElementsByClassName('.cta-btn--resume');
for(let el of elements){
el.href = url(MyResume);
}
}initSr();
initTilt();
addResume();
webpack.common.js:
module: {
rules: [
{
test: /\.html$/,
use: ['html-loader']
},
{
test: /\.(jpg|jpeg|png|gif|svg|pdf)$/,
use: [
{
loader: 'file-loader',
options: {
name: '[name].[ext]', //removed [hash]
outputPath: 'assets'
},
},
],
},
],
},
from simplefolio.
Hello @rckatz, I think you're getting problems because webpack doesn't know about PDF files. I'll check if I can solve that issue on the webpack config. Thank you for notice that issue, I'll let you know once I resolve this issue.
from simplefolio.
@cobidev,
How I eventually got it to work was adding an import line in the index.js file so it could "see" the PDF, added a function to add that link to the resume button href, and removed the [hash] from the file-loader, name line in the webpack.common file. (was something like [name][hash].[ext]) file-loader had PDF listed but it wasn't picking it up in the asset folder for whatever reason.
from simplefolio.
Very helpful. Thanks
from simplefolio.
Related Issues (20)
- Thanks!
- Upon updating node, an Error occurs. HOT 1
- MY PORTFOLIO
- Query required Using This Template
- The URL not working HOT 1
- Font Color. HOT 1
- CSS not showing while deploying in Netlify HOT 4
- Help HOT 1
- Error building react native project through parcel
- Parcel issue - one of many possible solutions
- yarn run auto reload?
- @parcel/transformer-js: (0 , _native.transform) is not a function
- Expected content key 200e56f57b917197 to exist
- Change favicon HOT 3
- Cannot load the CSS part HOT 3
- Issue with modifying favicon using RealFaviconGenerator HOT 1
- Navigation Bar HOT 1
- /well-known file HOT 3
- scrollRevealConfig.js BUILD FAILED
- Demo not working
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from simplefolio.